<?php

namespace App\Observers;

use App\Models\Comment;

class CommentObserver
{
    public function created(Comment $comment) {
        $comment->content = clean($comment->content,'default');
        $comment->topic->reply_count = $comment->topic->comments->count();
        $comment->topic->save();
    }
}
